﻿using System;

namespace MugenInjection.Wcf.ServiceHostImpl
{
    /// <summary>
    /// A service host that uses MugenInjection to create the service instances.
    /// </summary>
    public class MugenInjectionServiceHost : MugenInjectionServiceHostBase
    {
        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="MugenInjectionServiceHost"/> class. 
        /// </summary>
        protected MugenInjectionServiceHost()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="MugenInjectionServiceHost"/> class with the type of service and its base addresses specified.
        /// </summary>
        /// <param name="serviceType">The type of hosted service.</param><param name="baseAddresses">An array of type <see cref="T:System.Uri"/> that contains the base addresses for the hosted service.</param><exception cref="T:System.ArgumentNullException"><paramref name="serviceType"/> is null.</exception>
        public MugenInjectionServiceHost(Type serviceType, params Uri[] baseAddresses)
        {
            WcfConfigExtension.InitializeServiceHostOnCreate(serviceType, baseAddresses, InitializeDescription,
                                                     InitializeDescription);
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="MugenInjectionServiceHost"/> class with the instance of the service and its base addresses specified.
        /// </summary>
        /// <param name="singletonInstance">The instance of the hosted service.</param>
        ///<param name="baseAddresses">An array of type <see cref="T:System.Uri"/> that contains the base addresses for the hosted service.</param><exception cref="T:System.ArgumentNullException"><paramref name="singletonInstance"/> is null.</exception>
        public MugenInjectionServiceHost(object singletonInstance, params Uri[] baseAddresses)
            : base(singletonInstance, baseAddresses)
        {
        }

        #endregion
    }
}